package com.minyon_web_admin.common.sitemesh;

import org.sitemesh.SiteMeshContext;
import org.sitemesh.content.ContentProperty;
import org.sitemesh.content.tagrules.TagRuleBundle;
import org.sitemesh.content.tagrules.html.ExportTagToContentRule;
import org.sitemesh.tagprocessor.State;

/**
 * 默认子页面的底部js 会在父页面的js之前调用,出现js调用顺序的错误,添加自定义标签子页面的js可放置在最后
 * ClassName: CustomTagRuleBundle <br/> 
 * Function: TODO ADD FUNCTION. <br/> 
 * Reason: TODO ADD REASON(可选). <br/> 
 * date: 2016年10月16日 上午12:02:30 <br/> 
 * 
 * @author wuwenya 
 * @version  
 * @since JDK 1.7
 */
public class CustomTagRuleBundle implements TagRuleBundle {

	@Override
	public void install(State defaultState, ContentProperty contentProperty,
			SiteMeshContext siteMeshContext) {
		defaultState.addRule("subPageJs", new ExportTagToContentRule(siteMeshContext, contentProperty.getChild("subPageJs"), false));

	}

	@Override
	public void cleanUp(State defaultState, ContentProperty contentProperty,
			SiteMeshContext siteMeshContext) {
	}

}
